package com.example.Laboratory.Mapper;

import com.example.Laboratory.Entity.Achievements_patent;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Achievements_patentMapper {

    //增加科研成果-专利信息
    @Insert("INSERT INTO achievements_patent(achievements_patent_name,achievements_patent_type,achievements_patent_person,achievements_patent_year)VALUES(#{achievements_patent_name},#{achievements_patent_type},#{achievements_patent_person},#{achievements_patent_year})")
    int addAchievements_patent (Achievements_patent p);

    //根据id删除信息
    @Delete("DELETE FROM achievements_patent WHERE achievements_patent_id=#{achievements_patent_id}")
    int deleteAchievements_patent (int deleteAchievements_patent_id);

    //查找全表信息
    @Select("SELECT * FROM achievements_patent")
    List<Achievements_patent> researchAchievements_patent ( );


    //修改全部信息
    @Update("UPDATE achievements_patent SET achievements_patent_name=#{achievements_patent_name},achievements_patent_type=#{achievements_patent_type},achievements_patent_person=#{achievements_patent_person},achievements_patent_year=#{achievements_patent_year} where achievements_patent_id=#{achievements_patent_id}")
    int reviseAchievements_patent (Achievements_patent p);
}
